package com.chuji.crmcj.fragment;

import android.content.Context;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.TranslateAnimation;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.chuji.crmcj.R;
import com.chuji.crmcj.act.MainActivity;
import com.chuji.crmcj.utils.UIUtils;

import java.util.ArrayList;
import java.util.List;

public class FollowClientFragment extends Fragment {
    /*待跟进客户*/
    private Button btn_follow_up_client;
    /*跟进记录*/
    private Button btn_follow_table;
    /*蓝色下划线*/
    private ImageView follow_client_indicate_line;
    /*viewpager填充*/
    private ViewPager vp_follow_client;
    /*碎片集合*/
    private List<Fragment> fragments;

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragment_follow_client, container, false);
        //初始化组件
        btn_follow_up_client= (Button) view.findViewById(R.id.btn_follow_up_client);
        btn_follow_table= (Button) view.findViewById(R.id.btn_follow_table);
        btn_follow_up_client.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });
        btn_follow_table.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });

        fragments.add(new StandFollowFragment());//子fragment
        fragments.add(new FollowTableFragment());//子fragment

        return view;
    }
    //VpAdapter类
    public class VpAdapter extends FragmentPagerAdapter {

        private List<Fragment> list = new ArrayList<Fragment>();

        public VpAdapter(FragmentManager fm) {
            super(fm);
        }

        public VpAdapter(FragmentManager fm, List<Fragment> list) {
            super(fm);
            this.list = list;
        }

        @Override
        public Fragment getItem(int i) {
            return list.get(i);
        }

        @Override
        public int getCount() {
            return list.size();
        }

    }

}
